//
//  GoogleLocationNameDownloader.h
//  iCitySuzhou_iPad
//
//  Created by Jason Liu on 12/31/11.
//  Copyright 2011 Yulong. All rights reserved.
//

//	Revision History
//	2011-12-31 | Jason | 根据经纬度从服务器获取拼音字符串.

//  2013-6-17 modify by Frank

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
@protocol GoogleLocationNameDownloaderDelegate;

@interface GoogleLocationNameDownloader : NSObject {
	NSURLConnection         *LocationNameConnection;
    NSMutableData           *LocationNameData;
	id <GoogleLocationNameDownloaderDelegate> delegate;
	
	int						sourceTag;
	NSString				*paperURL;
    
    
    CLLocationCoordinate2D  coord;
    NSString                *locationName;
    NSString                *streetName;
}

@property (nonatomic, retain) NSURLConnection *LocationNameConnection;
@property (nonatomic, retain) NSMutableData *LocationNameData;
@property (nonatomic, assign) id <GoogleLocationNameDownloaderDelegate> delegate;
@property int sourceTag;
@property (nonatomic, retain) NSString *paperURL;
@property (nonatomic, retain) NSString *streetName;

- (void)startLocationNameDownload:(CLLocationCoordinate2D)coord;
- (void)cancelLocationNameDownload;
@end

@protocol GoogleLocationNameDownloaderDelegate <NSObject>
- (void)LocationNameDidLoad:(NSString *)locationName;
@optional
- (void)LocationNameLoadFailed:(NSError *)error;
- (void)StreetNameDidLoad:(NSString *)theStreetName;
@end